﻿public class SceneController : AbstractController
{
    private SceneModel scenemodel;
    private MemoryModel memorymodel;
    public SceneController()
    {
        EventCenter.Instance.RegisterObserver(EventType.OnSceneChangeComplete, OnSceneChange);
    }
    protected override void Init()
    {
        base.Init();
        scenemodel = ModelContainer.Instance.GetModel<SceneModel>();
        memorymodel = ModelContainer.Instance.GetModel<MemoryModel>();
    }
    private void OnSceneChange()
    {
        if (scenemodel.sceneName == SceneName.MiddleScene
            || scenemodel.sceneName == SceneName.MainMenuScene)
        {
            MemoryModelCommand.Instance.InitMemoryModel();
        }
    }
}
